<?php echo $this->fetch('header.html'); ?>
<div id="rightTop">
    <p>网站设置</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=setting&amp;act=base_setting">系统设置</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=base_information">基本信息</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=email_setting">Email</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=captcha_setting">验证码</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=store_setting">开店设置</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=credit_setting">前台设置</a></li>
        <li><span>二级域名</span></li>
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    是否启用二级域名:</th>
                <td class="paddingT15 wordSpacing5">
                    <?php echo $this->html_radios(array('name'=>'enabled_subdomain','options'=>$this->_var['yes_or_no'],'checked'=>$this->_var['config']['enabled_subdomain'])); ?>
                <span class="grey">启用二级域名需要您的服务器支持，具体配置方便请查看安装包中docs目录中的二级域名配置文档</span>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    二级域名后缀:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="subdomain_suffix" type="text" name="subdomain_suffix" value="<?php echo $this->_var['config']['subdomain_suffix']; ?>"/>
                <span class="grey">例如:用户的二级域名将是"test.mall.example.com", 则您只需要在此填写"mall.example.com"</span>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    保留域名:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="subdomain_reserved" type="text" name="subdomain_reserved" value="<?php echo $this->_var['setting']['subdomain_reserved']; ?>"/>
                <span class="grey">请输入您欲保留的二级域名，多个保留域名之间请用","号隔开</span>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    长度限制:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="subdomain_length" type="text" name="subdomain_length" value="<?php echo $this->_var['setting']['subdomain_length']; ?>"/>
                    <span class="grey">形如"3-12"，代表注册的域名限制在3到12个字符长度之间</span>
                </td>
            </tr>
            <tr>
              <th height="30" colspan="2" bgcolor="#f1f1f1">跨域上传图片配置</th>
            </tr>
            <tr>
              <th>跨域配置:</th>
              <td class="paddingT15">
<table id="table1" border="0">
<?php $_from = $this->_var['setting']['img_domain_ftp']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'imgftp');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['imgftp']):
?>
  <tr>
     <td>图片域:<input name="ftp_domain[]" type="text" style="width:120px" value="<?php echo $this->_var['key']; ?>"/>
       主机:<input type="text" name="ftp_hostname[]" style="width:120px" value="<?php echo $this->_var['imgftp']['hostname']; ?>"/>
       用户名:<input type="text" name="ftp_username[]" style="width:120px" value="<?php echo $this->_var['imgftp']['username']; ?>"/>
       密码:<input type="text" name="ftp_password[]" style="width:120px" value="<?php echo $this->_var['imgftp']['password']; ?>"/>
       端口:<input type="text" name="ftp_port[]" style="width:120px" value="<?php echo $this->_var['imgftp']['port']; ?>"/>
     </td>
     <td><a href="javascript:void(0)" onClick="delRow(this)">删除</a> <a href="javascript:void(0)" onClick="moveUp(this)">上移</a> <a href="javascript:void(0)" onClick="moveDown(this)">下移</a></td>
  </tr>
<?php endforeach; else: ?>
  <tr>
     <td>图片域:<input type="text" name="ftp_domain[]" style="width:120px"/>
       主机:<input type="text" name="ftp_hostname[]" style="width:120px"/>
       用户名:<input type="text" name="ftp_username[]" style="width:120px"/>
       密码:<input type="text" name="ftp_password[]" style="width:120px"/>
       端口:<input type="text" name="ftp_port[]" style="width:120px"/>
     </td>
     <td><a href="javascript:void(0)" onClick="moveUp(this)">上移</a> <a href="javascript:void(0)" onClick="moveDown(this)">下移</a></td>
  </tr>
<?php endif; unset($_from); ?><?php $this->pop_vars();; ?>  
</table>
<a href="javascript:;" id="add_adver">新增广告图片</a>
<script type="text/javascript">
$(function(){
	var i = 1;
    $("#add_adver").click(function(){
	  //$("#ad_adone:last").after($("#ad_adone:last").clone().val(0));
	  //复制一行
		var tr = $("#table1 tr").eq(0).clone();
		tr.show();
		tr.appendTo("#table1");	  
    });
});
<!--
//删除表格的行
function delRow(_a)
{
	var _row=_a.parentNode.parentNode;
	_row.parentNode.removeChild(_row);
}
//使表格行上移，接收参数为链接对象
function moveUp(_a){
    //通过链接对象获取表格行的引用
    var _row=_a.parentNode.parentNode;
    //如果不是第一行，则与上一行交换顺序
    if(_row.previousSibling)swapNode(_row,_row.previousSibling);
}
//使表格行下移，接收参数为链接对象
function moveDown(_a){
    //通过链接对象获取表格行的引用
    var _row=_a.parentNode.parentNode;
    //如果不是最后一行，则与下一行交换顺序
    if(_row.nextSibling)swapNode(_row,_row.nextSibling);
}
//定义通用的函数交换两个结点的位置
function swapNode(node1,node2){
    //获取父结点
    var _parent=node1.parentNode;
    //获取两个结点的相对位置
    var _t1=node1.nextSibling;
    var _t2=node2.nextSibling;
    //将node2插入到原来node1的位置
    if(_t1)_parent.insertBefore(node2,_t1);
    else _parent.appendChild(node2);
    //将node1插入到原来node2的位置
    if(_t2)_parent.insertBefore(node1,_t2);
    else _parent.appendChild(node1);
}
//-->
</script>              
              </td>
            </tr>
            <tr>
            <th></th>
            <td class="ptb20">
                <input class="formbtn" type="submit" name="Submit" value="提交" />
                <input class="formbtn" type="reset" name="Submit2" value="重置" />
            </td>
        </tr>
        </table>
    </form>
</div>
<?php echo $this->fetch('footer.html'); ?>
